package c.g.a.a;

import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;

/* compiled from: DeviceName */
public final class e {
    public final Context a;
    public final Handler b;
    public String c;
    public String d;

    /* compiled from: DeviceName */
    public final class a implements Runnable {
        public final c a;
        public d b;
        public Exception c;

        /* compiled from: DeviceName */
        public class a implements Runnable {
            public void run() {
                a aVar = a.this;
                aVar.a.a(aVar.b, aVar.c);
            }
        }

        public a(c cVar) {
            this.a = cVar;
        }

        public void run() {
            try {
                e eVar = e.this;
                this.b = c.f.a.a.a.a.p(eVar.a, eVar.c, eVar.d);
            } catch (Exception e) {
                this.c = e;
            }
            e.this.b.post(new a());
        }
    }

    public e(Context context, b bVar) {
        this.a = context;
        this.b = new Handler(context.getMainLooper());
    }

    public void a(c cVar) {
        if (this.c == null && this.d == null) {
            this.c = Build.DEVICE;
            this.d = Build.MODEL;
        }
        a aVar = new a(cVar);
        if (Looper.myLooper() == Looper.getMainLooper()) {
            new Thread(aVar).start();
        } else {
            aVar.run();
        }
    }
}
